

<!DOCTYPE html>
<html lang="zh-CN" color-mode=light>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>快速搭建个人博客 Hexo &amp;&amp; Gitee - Xiaozhou`s Blog-小州的个人博客</title>
  <meta name="apple-mobile-web-app-capable" content="yes" />
  <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  <meta name="google" content="notranslate" />
  <meta name="keywords" content="Blog,Java,Spring,SpringBoot,SSM,Linux">
  <meta name="description" content="Quick Start1.安装Nodejs 和Git1...">
  <meta name="author" content="xiaozhou">
  <link rel="icon" href="/images/icons/favicon-16x16.png" type="image/png" sizes="16x16">
  <link rel="icon" href="/images/icons/favicon-32x32.png" type="image/png" sizes="32x32">
  <link rel="apple-touch-icon" href="/images/icons/apple-touch-icon.png" sizes="180x180">
  <meta rel="mask-icon" href="/images/icons/stun-logo.svg" color="#333333">
  
    <meta rel="msapplication-TileImage" content="/images/icons/favicon-144x144.png">
    <meta rel="msapplication-TileColor" content="#000000">
  

  
<link rel="stylesheet" href="/css/style.css">


  
    
<link rel="stylesheet" href="//at.alicdn.com/t/font_1445822_s6x2xcokxrl.css">

  

  
    
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.5.7/jquery.fancybox.min.css">

  

  
    
      
        
        
<link rel="stylesheet" href="https://cdn.bootcss.com/highlight.js/9.18.1/styles/xcode.min.css" name="highlight-style" mode="light">

      
        
        
<link rel="stylesheet" href="https://cdn.bootcss.com/highlight.js/9.18.1/styles/solarized-dark.min.css" name="highlight-style" mode="dark">

      
  

  <script>
    var CONFIG = window.CONFIG || {};
    var ZHAOO = window.ZHAOO || {};
    CONFIG = {
      isHome: false,
      fancybox: true,
      pjax: false,
      lazyload: {
        enable: true,
        only_post: 'false',
        loading: 'https://gitee.com/xiaozhoujun/personal-drawing-bed/raw/master/loading.gif'
      },
      donate: {
        enable: true,
        alipay: '/images/theme/alipay.jpg',
        wechat: '/images/theme/wechat.jpg'
      },
      galleries: {
        enable: true
      },
      fab: {
        enable: true,
        always_show: false
      },
      carrier: {
        enable: true
      },
      daovoice: {
        enable: false
      },
      preview: {
        background: {
          default: '/images/theme/welcome-image.jpg',
          api: 'https://api.ixiaowai.cn/gqapi/gqapi.php'
        },
        motto: {
          default: '我在开了灯的床头下，想问问自己的心啊。',
          api: 'https://v2.jinrishici.com/one.json',
          data_contents: '["data","content"]'
        },
      },
      qrcode: {
        enable: false,
        type: 'url',
        image: 'https://pic.izhaoo.com/weapp-code.jpg',
      },
      toc: {
        enable: true
      },
      scrollbar: {
        type: 'simple'
      },
      notification: {
        enable: false,
        delay: 4500,
        list: '',
        page_white_list: '',
        page_black_list: ''
      }
    }
  </script>

  

  

<meta name="generator" content="Hexo 5.3.0"></head>

<body class="lock-screen">
  <div class="loading"></div>
  


  <nav class="navbar">
    <div class="left">
      
      
        <i class="iconfont iconmoono" id="color-toggle" color-toggle="light"></i>
      
    </div>
    <div class="center">快速搭建个人博客 Hexo &amp;&amp; Gitee</div>
    <div class="right">
      <i class="iconfont iconmenu j-navbar-menu"></i>
    </div>
    
  </nav>

  

<nav class="menu">
  <div class="menu-wrap">
    <div class="menu-close">
      <i class="iconfont iconbaseline-close-px"></i>
    </div>
    <ul class="menu-content"><li class="menu-item">
        <a href="/ " class="underline "> 首页</a>
      </li><li class="menu-item">
        <a href="/archives/ " class="underline "> 归档</a>
      </li><li class="menu-item">
        <a href="/galleries/ " class="underline "> 相册</a>
      </li><li class="menu-item">
        <a href="/tags/ " class="underline "> 标签</a>
      </li><li class="menu-item">
        <a href="/categories/ " class="underline "> 分类</a>
      </li><li class="menu-item">
        <a href="/friends/ " class="underline "> 友链</a>
      </li><li class="menu-item">
        <a href="/about/ " class="underline "> 关于</a>
      </li></ul>
    
      <div class="menu-copyright"><p>Powered by <a target="_blank" href="https://hexo.io">Hexo</a>  |  Theme - <a target="_blank" href="https://github.com/izhaoo/hexo-theme-zhaoo">zhaoo</a></p></div>
    
  </div>
</nav>
  <main id="main">
  <div class="article-wrap">
    <div class="row container">
      <div class="col-xl-3"></div>
      <div class="col-xl-6"><article class="article">
  <div class="wrap">
    <section class="head">
  <img   class="lazyload" data-original="/images/post/cover-01.jpg" src=""  draggable="false">
  <div class="head-mask">
    <h1 class="head-title">快速搭建个人博客 Hexo &amp;&amp; Gitee</h1>
    <div class="head-info">
      <span class="post-info-item"><i class="iconfont iconcalendar"></i>一月 11, 2021</span>
      
      <span class="post-info-item"><i class="iconfont iconfont-size"></i>1743</span>
    </div>
  </div>
</section>
    <section class="main">
      <section class="content">
        <h2 id="Quick-Start"><a href="#Quick-Start" class="headerlink" title="Quick Start"></a>Quick Start</h2><h3 id="1-安装Nodejs-和Git"><a href="#1-安装Nodejs-和Git" class="headerlink" title="1.安装Nodejs 和Git"></a>1.安装Nodejs 和Git</h3><figure class="highlight awk"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><code class="hljs awk">http:<span class="hljs-regexp">//</span>nodejs.cn<span class="hljs-regexp">/download/</span>  <span class="hljs-comment">#node下载地址</span><br>node -v	<span class="hljs-comment">#查看node版本</span><br>npm -v	<span class="hljs-comment">#查看npm版本</span><br>https:<span class="hljs-regexp">//gi</span>t-scm.com/downloads <span class="hljs-comment">#Git下载地址</span><br>git --version  <span class="hljs-comment">#查看Git版本</span><br></code></pre></td></tr></table></figure>
<h3 id="2-安装淘宝的cnpm包管理器"><a href="#2-安装淘宝的cnpm包管理器" class="headerlink" title="2.安装淘宝的cnpm包管理器"></a>2.安装淘宝的cnpm包管理器</h3><figure class="highlight awk"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs awk">npm install -g cnpm --registry=http:<span class="hljs-regexp">//</span>registry.npm.taobao.org <span class="hljs-comment">#安装淘宝的cnpm包管理器</span><br>cnpm -v	<span class="hljs-comment">#查看cnpm版本</span><br></code></pre></td></tr></table></figure>
<h3 id="3-安装Hexo框架"><a href="#3-安装Hexo框架" class="headerlink" title="3.安装Hexo框架"></a>3.安装Hexo框架</h3><figure class="highlight awk"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><code class="hljs awk">cnpm install -g hexo-cli  <span class="hljs-comment">#安装Hexo框架  </span><br>hexo -v	<span class="hljs-comment">#查看hexo版本</span><br>mkdir blog	<span class="hljs-comment">#创建blog目录</span><br>cd blog	 <span class="hljs-comment">#进入blog目录</span><br>sudo hexo init 	<span class="hljs-comment">#生成博客 初始化博客</span><br>hexo s	<span class="hljs-comment">#启动本地博客服务</span><br>http:<span class="hljs-regexp">//</span>localhost:<span class="hljs-number">4000</span>/	<span class="hljs-comment">#本地访问地址</span><br><br>hexo n <span class="hljs-string">&quot;我的第一篇文章&quot;</span> <span class="hljs-comment">#创建新的文章 </span><br><span class="hljs-comment">#返回blog目录</span><br>hexo clean <span class="hljs-comment">#清理</span><br>hexo g <span class="hljs-comment">#生成</span><br>hexo s	<span class="hljs-comment">#启动本地博客服务</span><br>http:<span class="hljs-regexp">//</span>localhost:<span class="hljs-number">4000</span>/	<span class="hljs-comment">#本地访问地址</span><br></code></pre></td></tr></table></figure>
<h3 id="4-修改主题"><a href="#4-修改主题" class="headerlink" title="4.修改主题"></a>4.修改主题</h3><figure class="highlight awk"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><code class="hljs awk">git clone https:<span class="hljs-regexp">//gi</span>thub.com<span class="hljs-regexp">/litten/</span>hexo-theme-yilia.git themes/yilia  <span class="hljs-comment">#下载yilia主题到本地</span><br><span class="hljs-comment">#修改hexo根目录下的 _config.yml 文件 ： theme: yilia</span><br>hexo clean <span class="hljs-comment">#清理一下</span><br>hexo g	<span class="hljs-comment">#生成</span><br>hexo s	<span class="hljs-comment">#启动本地博客服务</span><br>http:<span class="hljs-regexp">//</span>localhost:<span class="hljs-number">4000</span>/	<span class="hljs-comment">#本地访问地址</span><br></code></pre></td></tr></table></figure>
<h3 id="5-部署到Gitee"><a href="#5-部署到Gitee" class="headerlink" title="5.部署到Gitee"></a>5.部署到Gitee</h3><p>4.1 在<a target="_blank" rel="noopener" href="https://gitee.com/">Gitee</a>新建一个名为个人用户名的仓库,在服务选项中开启<strong>Gitee Pages</strong>服务</p>
<p>配置blog根目录config.yml文件</p>
<figure class="highlight vim"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><code class="hljs vim"># URL<br>## If your site <span class="hljs-keyword">is</span> <span class="hljs-keyword">put</span> in <span class="hljs-keyword">a</span> subdirectory, <span class="hljs-keyword">set</span> url <span class="hljs-keyword">as</span> <span class="hljs-string">&#x27;http://example.com/child&#x27;</span> <span class="hljs-built_in">and</span> root <span class="hljs-keyword">as</span> <span class="hljs-string">&#x27;/child/&#x27;</span><br># ur<span class="hljs-variable">l:</span> http://example.<span class="hljs-keyword">com</span><br>ur<span class="hljs-variable">l:</span> http<span class="hljs-variable">s:</span>//YourGiteebName.gitee.io<br>roo<span class="hljs-variable">t:</span> /<br>permalink: :year/:month/:day/:title/<br>permalink_default<span class="hljs-variable">s:</span><br>pretty_url<span class="hljs-variable">s:</span><br>  trailing_index: true # Set <span class="hljs-keyword">to</span> false <span class="hljs-keyword">to</span> <span class="hljs-built_in">remove</span> trailing <span class="hljs-string">&#x27;index.html&#x27;</span> from permalinks<br>  trailing_htm<span class="hljs-variable">l:</span> true # Set <span class="hljs-keyword">to</span> false <span class="hljs-keyword">to</span> <span class="hljs-built_in">remove</span> trailing <span class="hljs-string">&#x27;.html&#x27;</span> from permalinks<br><br><br># Deployment<br>	## Doc<span class="hljs-variable">s:</span> http<span class="hljs-variable">s:</span>//hexo.io/docs/deployment.html<br>	deploy:<br>  	<span class="hljs-built_in">type</span>: git<br> 	repo: http<span class="hljs-variable">s:</span>//gitee.<span class="hljs-keyword">com</span>/YourGiteebName/YourGiteebName.git	<br>  	branch: master<br></code></pre></td></tr></table></figure>
<p>4.2 推送到Gitee</p>
<figure class="highlight cmake"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><code class="hljs cmake">cnpm <span class="hljs-keyword">install</span> --save hexo-deployer-git <span class="hljs-comment">#在Blog根目录下安装git部署插件</span><br>hexo clean <span class="hljs-comment">#清理一下</span><br>hexo g	<span class="hljs-comment">#生成</span><br>hexo d <span class="hljs-comment">#推送到Gitee</span><br></code></pre></td></tr></table></figure>
<p>4.3 在仓库的服务选项中–Gitee Pages 服务 点击更新</p>
<p>点击  <a target="_blank" rel="noopener" href="https://giteebname.gitee.io/">https://YourGiteebName.gitee.io</a>  查看效果</p>
<h2 id="其他插件"><a href="#其他插件" class="headerlink" title="其他插件"></a>其他插件</h2><figure class="highlight cmake"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs cmake">npm <span class="hljs-keyword">install</span> hexo-abbrlink --save  <span class="hljs-comment">#链接转换插件</span><br></code></pre></td></tr></table></figure>




      </section>
      <section class="extra">
        
        
          <section class="donate">
  <div id="qrcode-donate">
    <img   class="lazyload" data-original="/images/theme/alipay.jpg" src="" >
  </div>
  <div class="icon">
    <a href="javascript:;" id="alipay"><i class="iconfont iconalipay"></i></a>
    <a href="javascript:;" id="wechat"><i class="iconfont iconwechat-fill"></i></a>
  </div>
</section>
        
        
  <ul class="tag-list" itemprop="keywords"><li class="tag-list-item"><a class="tag-list-link" href="/tags/hexo-Gitee-%E5%8D%9A%E5%AE%A2/" rel="tag">hexo , Gitee,博客</a></li></ul> 

        
  <nav class="nav">
    <a href="/2021/01/12/docker%20%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4/"><i class="iconfont iconleft"></i>docker 常用命令</a>
    <a href="/2021/01/11/Hexo-Themes-zhaoo%20%E4%B8%BB%E9%A2%98%E4%BD%BF%E7%94%A8%E6%96%87%E6%A1%A3/">Hexo-Themes-zhaoo 主题使用文档<i class="iconfont iconright"></i></a>
  </nav>

      </section>
      
        <section class="comments">
  
  
<div id="valine"></div>
<script defer src="//unpkg.com/valine/dist/Valine.min.js"></script>
<script>
  window.onload = function () {
    var loadValine = function () {
      new Valine({
        el: '#valine',
        app_id: "DT7lf4wjyGz3dzFvkNWkjDjw-gzGzoHsz",
        app_key: "0BFENrKLIvytrnTsCPNxF5tP",
        placeholder: "雁过留痕",
        avatar: "mp",
        pageSize: "10",
        lang: "zh-CN",
      });
    }
    if ( false ) {
      $("#comments-btn").on("click", function () {
        $(this).hide();
        loadValine();
      });
    } else {
      loadValine();
    }
  };
</script>

</section>
      
    </section>
  </div>
</article></div>
      <div class="col-xl-3">
        
          
  <aside class="toc-wrap">
    <h3 class="toc-title">文章目录：</h3>
    <ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#Quick-Start"><span class="toc-text">Quick Start</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#1-%E5%AE%89%E8%A3%85Nodejs-%E5%92%8CGit"><span class="toc-text">1.安装Nodejs 和Git</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#2-%E5%AE%89%E8%A3%85%E6%B7%98%E5%AE%9D%E7%9A%84cnpm%E5%8C%85%E7%AE%A1%E7%90%86%E5%99%A8"><span class="toc-text">2.安装淘宝的cnpm包管理器</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#3-%E5%AE%89%E8%A3%85Hexo%E6%A1%86%E6%9E%B6"><span class="toc-text">3.安装Hexo框架</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#4-%E4%BF%AE%E6%94%B9%E4%B8%BB%E9%A2%98"><span class="toc-text">4.修改主题</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#5-%E9%83%A8%E7%BD%B2%E5%88%B0Gitee"><span class="toc-text">5.部署到Gitee</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%85%B6%E4%BB%96%E6%8F%92%E4%BB%B6"><span class="toc-text">其他插件</span></a></li></ol>
  </aside>

        
      </div>
    </div>
  </div>
</main>
  

<footer class="footer">
  <div class="footer-social"><a 
        href="tencent://message/?Menu=yes&uin=574385240 "
        target="_blank"
        class="footer-social-item"
        onMouseOver="this.style.color= '#DA2E76'" 
        onMouseOut="this.style.color='#33333D'">
          <i class="iconfont  iconQQ "></i>
      </a><a 
        href="javascript:; "
        target="_blank"
        class="footer-social-item"
        onMouseOver="this.style.color= '#09BB07'" 
        onMouseOut="this.style.color='#33333D'">
          <i class="iconfont  iconwechat-fill "></i>
      </a><a 
        href="https://www.instagram.com/ "
        target="_blank"
        class="footer-social-item"
        onMouseOver="this.style.color= '#DA2E76'" 
        onMouseOut="this.style.color='#33333D'">
          <i class="iconfont  iconinstagram "></i>
      </a><a 
        href="https://github.com/xiaozhoujun "
        target="_blank"
        class="footer-social-item"
        onMouseOver="this.style.color= '#9f7be1'" 
        onMouseOut="this.style.color='#33333D'">
          <i class="iconfont  icongithub-fill "></i>
      </a><a 
        href="mailto:xiaozhou1650@gmail.com "
        target="_blank"
        class="footer-social-item"
        onMouseOver="this.style.color= '#DA2E76'" 
        onMouseOut="this.style.color='#33333D'">
          <i class="iconfont  iconmail "></i>
      </a></div>
  
    <div class="footer-copyright"><p>Powered by <a target="_blank" href="https://hexo.io">Hexo</a>  |  Theme - <a target="_blank" href="https://github.com/izhaoo/hexo-theme-zhaoo">zhaoo</a></p></div>
  
</footer>
  
      <div class="fab fab-plus">
    <i class="iconfont iconplus"></i>
  </div>
  
  
  <div class="fab fab-up">
    <i class="iconfont iconcaret-up"></i>
  </div>
  
  
    <div class="scrollbar j-scrollbar">
  <div class="scrollbar-current j-scrollbar-current"></div>
</div>
  
  
    
<script src="/js/color-mode.js"></script>

  
<script src="/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"pluginRootPath":"live2dw/","pluginJsPath":"lib/","pluginModelPath":"assets/","tagMode":false,"debug":false,"model":{"jsonPath":"/live2dw/assets/assets/shizuku.model.json"},"display":{"position":"Left","width":150,"height":300},"mobile":{"show":true},"log":false});</script></body>

<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>



  
<script src="https://cdn.bootcdn.net/ajax/libs/jquery.lazyload/1.9.1/jquery.lazyload.min.js"></script>




  
<script src="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.5.7/jquery.fancybox.min.js"></script>








<script src="/js/utils.js"></script>
<script src="/js/script.js"></script>







  <script>
    (function () {
      var bp = document.createElement('script');
      var curProtocol = window.location.protocol.split(':')[0];
      if (curProtocol === 'https') {
        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
      } else {
        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
      }
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(bp, s);
    })();
  </script>













</html>